<?php

use yii\helpers\Html;
use yii\helpers\Url;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model common\models\MktSourcePromotion */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="mkt-source-promotion-form">

    <?php $form = ActiveForm::begin(); ?>

    <?= $form->field($model, 'user_id')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'promotion_channel_id')->textInput(['maxlength' => true]) ?>

<!--
    <//?= $form->field($model, 'promotion_fan_industry')->textInput(['maxlength' => true]) ?>
-->

    <?php echo $form->field($model, 'parent_promotion_fan_industry')->dropDownList(\yii\helpers\ArrayHelper::map(
        \common\models\MktIndustry::find()->children()->all(),
        'id',
        'title'
    ), ['prompt'=>'选择行业...', 'id'=>'parent_promotion_fan_industry'])->label('行业'); ?>

    <?php echo $form->field($model, 'promotion_fan_industry')->label('子行业')->widget(\kartik\depdrop\DepDrop::classname(), [
         'options' => ['id' => 'promotion_fan_industry'],
         'pluginOptions'=>[
             'depends'=>['parent_promotion_fan_industry'],
             'placeholder' => '选择子行业...',
             'url' => Url::to(['industry/subcat'])
         ]
     ]); ?>


<!--
    <//?= $form->field($model, 'promotion_fan_area')->textInput(['maxlength' => true]) ?>
-->

    <?php echo $form->field($model, 'parent_promotion_fan_area')->dropDownList(\yii\helpers\ArrayHelper::map(
        \common\models\MktArea::find()->children()->all(),
        'id',
        'title'
    ), ['prompt'=>'选择区域...', 'id'=>'parent_promotion_fan_area'])->label('区域'); ?>

    <?php echo $form->field($model, 'promotion_fan_area')->label('商圈')->widget(\kartik\depdrop\DepDrop::classname(), [
         'options' => ['id' => 'promotion_fan_area'],
         'pluginOptions'=>[
             'depends'=>['parent_promotion_fan_area'],
             'placeholder' => '选择商圈...',
             'url' => Url::to(['area/subcat'])
         ]
     ]); ?>


    <?= $form->field($model, 'promotion_fan_count')->textInput(['maxlength' => true]) ?>

    <div class="form-group">
        <?= Html::submitButton($model->isNewRecord ? '创建' : '更新', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
    </div>

    <?php ActiveForm::end(); ?>

</div>
